@extends('backend/layouts/default')
@section('title')
Sắp xếp giáo trình
@stop
@section('content')
<h3>
    <span class="glyphicon glyphicon-user"></span> Sắp xếp giáo trình
</h3>
<form class="form-horizontal" method="post" action="" fole="form">
    {{ Form::token()}}
    <input type="hidden" name="pid" value="<?= $data['id'] ?>"/>

    <div class="row">
        <div class="col-sm-9">
            <table class="table">
                <thead>
                <th># ID</th>
                <th>Tên</th>
                <th>Vị trí</th>
                </thead>
                <tbody>
                @foreach($data['units'] as $unit)
                <tr>
                    <input type="hidden" name="id[]" value="<?= $unit->id ?>"/>
                    <td><?= $unit->id ?></td>
                    <td><a href="<?= route('detail/unit', $unit->slug) ?>"><?= $unit->title ?></a></td>
                    <td>
                        <input type="text" name="unit_{{ $unit->id }}" value="<?= $unit->position ?>"/>
                    </td>
                </tr>

                @endforeach
                </tbody>
            </table>
            <div class="control-group" align="right">
                <div class="controls">
                    <a class="btn btn-link" href="{{ route('units') }}">Hủy</a>
                    <button type="submit" class="btn btn-success">Lưu</button>
                </div>
            </div>
        </div>
    </div>
</form>
@stop